<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>linux学习 | mundane</title><meta name="author" content="frode"><meta name="copyright" content="frode"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="Linux第一次使用finalshell时，在Ubuntu的ip地址和用户名及密码都正确，但是连接主机时，一直显示拒绝连接。 主要原因是，Ubuntu主机缺少openssh-server 插件，输入如下命令即可安装插件 sudo apt-get install openssh-server  安装成功后，再次查询IP地址，打开finalshell进行连接即可 WSL  Linux的目录结构  Li">
<meta property="og:type" content="article">
<meta property="og:title" content="linux学习">
<meta property="og:url" content="https://gitee.com/frode117/2023/04/16/linux%E5%AD%A6%E4%B9%A0/index.html">
<meta property="og:site_name" content="mundane">
<meta property="og:description" content="Linux第一次使用finalshell时，在Ubuntu的ip地址和用户名及密码都正确，但是连接主机时，一直显示拒绝连接。 主要原因是，Ubuntu主机缺少openssh-server 插件，输入如下命令即可安装插件 sudo apt-get install openssh-server  安装成功后，再次查询IP地址，打开finalshell进行连接即可 WSL  Linux的目录结构  Li">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/frode117/img/twist.png">
<meta property="article:published_time" content="2023-04-16T14:52:19.000Z">
<meta property="article:modified_time" content="2023-04-16T15:13:06.651Z">
<meta property="article:author" content="frode">
<meta property="article:tag" content="linux">
<meta property="article:tag" content="虚拟机">
<meta property="article:tag" content="ubuntu">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gitee.com/frode117/img/twist.png"><link rel="shortcut icon" href="/mundane/img/ai.jpg"><link rel="canonical" href="https://gitee.com/frode117/2023/04/16/linux%E5%AD%A6%E4%B9%A0/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/mundane/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/mundane/',
  algolia: undefined,
  localSearch: {"path":"/mundane/search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}","hits_stats":"共找到 ${hits} 篇文章"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  dateSuffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#1f1f1f","position":"bottom-right"},
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: true,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  }
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'linux学习',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-04-16 23:13:06'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = (url,id = false) => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      if (id) link.id = id
      link.onerror = reject
      link.onload = link.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        link.onload = link.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><svg aria-hidden="true" style="position:absolute; overflow:hidden; width:0; height:0"><symbol id="icon-sun" viewBox="0 0 1024 1024"><path d="M960 512l-128 128v192h-192l-128 128-128-128H192v-192l-128-128 128-128V192h192l128-128 128 128h192v192z" fill="#FFD878" p-id="8420"></path><path d="M736 512a224 224 0 1 0-448 0 224 224 0 1 0 448 0z" fill="#FFE4A9" p-id="8421"></path><path d="M512 109.248L626.752 224H800v173.248L914.752 512 800 626.752V800h-173.248L512 914.752 397.248 800H224v-173.248L109.248 512 224 397.248V224h173.248L512 109.248M512 64l-128 128H192v192l-128 128 128 128v192h192l128 128 128-128h192v-192l128-128-128-128V192h-192l-128-128z" fill="#4D5152" p-id="8422"></path><path d="M512 320c105.888 0 192 86.112 192 192s-86.112 192-192 192-192-86.112-192-192 86.112-192 192-192m0-32a224 224 0 1 0 0 448 224 224 0 0 0 0-448z" fill="#4D5152" p-id="8423"></path></symbol><symbol id="icon-moon" viewBox="0 0 1024 1024"><path d="M611.370667 167.082667a445.013333 445.013333 0 0 1-38.4 161.834666 477.824 477.824 0 0 1-244.736 244.394667 445.141333 445.141333 0 0 1-161.109334 38.058667 85.077333 85.077333 0 0 0-65.066666 135.722666A462.08 462.08 0 1 0 747.093333 102.058667a85.077333 85.077333 0 0 0-135.722666 65.024z" fill="#FFB531" p-id="11345"></path><path d="M329.728 274.133333l35.157333-35.157333a21.333333 21.333333 0 1 0-30.165333-30.165333l-35.157333 35.157333-35.114667-35.157333a21.333333 21.333333 0 0 0-30.165333 30.165333l35.114666 35.157333-35.114666 35.157334a21.333333 21.333333 0 1 0 30.165333 30.165333l35.114667-35.157333 35.157333 35.157333a21.333333 21.333333 0 1 0 30.165333-30.165333z" fill="#030835" p-id="11346"></path></symbol></svg><meta name="generator" content="Hexo 6.3.0"><link rel="alternate" href="/mundane/atom.xml" title="mundane" type="application/atom+xml">
</head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/mundane/img/violet.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/mundane/archives/"><div class="headline">文章</div><div class="length-num">4</div></a><a href="/mundane/tags/"><div class="headline">标签</div><div class="length-num">8</div></a><a href="/mundane/categories/"><div class="headline">分类</div><div class="length-num">4</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/mundane/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/mundane/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/mundane/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/mundane/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/mundane/messageboard/"><i class="fa-fw fa fa-paper-plane"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/mundane/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa fa-list"></i><span> 菜单</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/mundane/myself/"><i class="fa-fw fa fa-id-card"></i><span> myself</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly/"><i class="fa-fw fa fa-heart"></i><span> butterfly主题</span></a></li></ul></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('/mundane/img/twist.png')"><nav id="nav"><span id="blog-info"><a href="/mundane/" title="mundane"><span class="site-name">mundane</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/mundane/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/mundane/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/mundane/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/mundane/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/mundane/messageboard/"><i class="fa-fw fa fa-paper-plane"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/mundane/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa fa-list"></i><span> 菜单</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/mundane/myself/"><i class="fa-fw fa fa-id-card"></i><span> myself</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly/"><i class="fa-fw fa fa-heart"></i><span> butterfly主题</span></a></li></ul></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">linux学习</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2023-04-16T14:52:19.000Z" title="发表于 2023-04-16 22:52:19">2023-04-16</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-04-16T15:13:06.651Z" title="更新于 2023-04-16 23:13:06">2023-04-16</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/mundane/categories/linux%E5%AD%A6%E4%B9%A0/">linux学习</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">2.6k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>12分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="linux学习"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="Linux"><a href="#Linux" class="headerlink" title="Linux"></a>Linux</h1><p>第一次使用<a target="_blank" rel="noopener" href="https://so.csdn.net/so/search?q=finalshell&spm=1001.2101.3001.7020">finalshell</a>时，在Ubuntu的ip地址和用户名及密码都正确，但是连接主机时，一直显示拒绝连接。</p>
<p>主要原因是，Ubuntu主机缺少<a target="_blank" rel="noopener" href="https://so.csdn.net/so/search?q=openssh&spm=1001.2101.3001.7020">openssh</a>-server 插件，输入如下命令即可安装插件</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line">sudo apt-get install openssh-server</span><br></pre></td></tr></table></figure>

<p>安装成功后，再次查询IP地址，打开finalshell进行连接即可</p>
<h2 id="WSL"><a href="#WSL" class="headerlink" title="WSL"></a>WSL</h2><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230413220515950.png" alt="image-20230413220515950"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230412140723886.png" alt="image-20230412140723886"></p>
<h2 id="Linux的目录结构"><a href="#Linux的目录结构" class="headerlink" title="Linux的目录结构"></a>Linux的目录结构</h2><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230413222427349.png" alt="image-20230413222427349"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230413222555262.png" alt="image-20230413222555262"></p>
<h2 id="Linux基础命令"><a href="#Linux基础命令" class="headerlink" title="Linux基础命令"></a>Linux基础命令</h2><h3 id="命令和命令行"><a href="#命令和命令行" class="headerlink" title="命令和命令行"></a>命令和命令行</h3><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230413222829777.png" alt="image-20230413222829777"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230413223121831.png" alt="image-20230413223121831"></p>
<h3 id="ls命令入门"><a href="#ls命令入门" class="headerlink" title="ls命令入门"></a>ls命令入门</h3><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230413223422941.png" alt="image-20230413223422941"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230413223918867.png" alt="image-20230413223918867"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230413224051161.png" alt="image-20230413224051161"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230413224526471.png" alt="image-20230413224526471"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230413225115057.png" alt="image-20230413225115057"></p>
<h3 id="文件操作命令"><a href="#文件操作命令" class="headerlink" title="文件操作命令"></a>文件操作命令</h3><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230413225708048.png" alt="image-20230413225708048"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230413231301559.png" alt="image-20230413231301559"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230413231325268.png" alt="image-20230413231325268"></p>
<p>rm -rf &#x2F;*</p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414123842766.png" alt="image-20230414123842766"></p>
<h3 id="管道符"><a href="#管道符" class="headerlink" title="管道符"></a>管道符</h3><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414162111462.png" alt="image-20230414162111462"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414162920355.png" alt="image-20230414162920355"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414164259525.png" alt="image-20230414164259525"></p>
<h3 id="vim命令"><a href="#vim命令" class="headerlink" title="vim命令"></a>vim命令</h3><p>菜鸟教程</p>
<p><img src="https://www.runoob.com/wp-content/uploads/2015/10/vi-vim-cheat-sheet-sch.gif" alt="img"></p>
<h3 id="scp命令"><a href="#scp命令" class="headerlink" title="scp命令"></a>scp命令</h3><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230415152218744.png" alt="image-20230415152218744"></p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">scp -r test node2:`pwd` # 漂号pwd放到同名目录下</span><br></pre></td></tr></table></figure>

<h2 id="Linux权限管控"><a href="#Linux权限管控" class="headerlink" title="Linux权限管控"></a>Linux权限管控</h2><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414164934765.png" alt="image-20230414164934765"></p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line">visudo</span><br><span class="line">vi /etc/sudoers</span><br><span class="line"></span><br><span class="line">itheima ALL=(ALL) NOPASSWD:ALL</span><br><span class="line">sudo <span class="built_in">mkdir</span> /test</span><br></pre></td></tr></table></figure>

<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414165908255.png" alt="image-20230414165908255"></p>
<p><strong><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414170229312.png" alt="image-20230414170229312"></strong></p>
<p><strong><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414170603190.png" alt="image-20230414170603190"></strong></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414170834943.png" alt="image-20230414170834943"></p>
<h2 id="Linux实用操作"><a href="#Linux实用操作" class="headerlink" title="Linux实用操作"></a>Linux实用操作</h2><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414171328920.png" alt="image-20230414171328920"></p>
<p><strong><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414171643781.png" alt="image-20230414171643781"></strong></p>
<p><strong><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414172411701.png" alt="image-20230414172411701"></strong></p>
<h3 id="软链接"><a href="#软链接" class="headerlink" title="软链接"></a>软链接</h3><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414180933709.png" alt="image-20230414180933709"></p>
<h3 id="显示时间"><a href="#显示时间" class="headerlink" title="显示时间"></a>显示时间</h3><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">date &quot;+%Y-%m-%d %H:%M:%S&quot;</span><br></pre></td></tr></table></figure>

<h4 id="校准时间"><a href="#校准时间" class="headerlink" title="校准时间"></a>校准时间</h4><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414182041908.png" alt="image-20230414182041908"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414183225573.png" alt="image-20230414183225573"></p>
<h3 id="设置静态ip"><a href="#设置静态ip" class="headerlink" title="设置静态ip"></a>设置静态ip</h3><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414190813994.png" alt="image-20230414190813994"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414190832568.png" alt="image-20230414190832568"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414200816256.png" alt="image-20230414200816256"></p>
<h3 id="端口"><a href="#端口" class="headerlink" title="端口"></a>端口</h3><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414201153176.png" alt="image-20230414201153176"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414202638338.png" alt="image-20230414202638338"></p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line">netstat -anp | grep 22</span><br></pre></td></tr></table></figure>

<p><strong><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414203230947.png" alt="image-20230414203230947"></strong></p>
<p>列出全部进程的全部信息</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">ps -ef</span><br><span class="line">ps -ef | grep &quot;20:35&quot;</span><br><span class="line">kill -9 进程号</span><br></pre></td></tr></table></figure>

<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414204114698.png" alt="image-20230414204114698"></p>
<p>terminated 进程自己关闭</p>
<p>killed               加 -9 选项后强制关闭</p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414204735240.png" alt="image-20230414204735240"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414204803149.png" alt="image-20230414204803149"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414205840786.png" alt="image-20230414205840786"></p>
<h3 id="自行设置环境变量"><a href="#自行设置环境变量" class="headerlink" title="自行设置环境变量"></a>自行设置环境变量</h3><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414210635307.png" alt="image-20230414210635307"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414211131153.png" alt="image-20230414211131153"></p>
<h3 id="压缩解压"><a href="#压缩解压" class="headerlink" title="压缩解压"></a>压缩解压</h3><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414213548981.png" alt="image-20230414213548981"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414213921832.png" alt="image-20230414213921832"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414214332246.png" alt="image-20230414214332246"></p>
<h2 id="实战软件部署"><a href="#实战软件部署" class="headerlink" title="实战软件部署"></a>实战软件部署</h2><h3 id="Mysql"><a href="#Mysql" class="headerlink" title="Mysql"></a>Mysql</h3><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414214914150.png" alt="image-20230414214914150"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414215926345.png" alt="image-20230414215926345"></p>
<p>设置密码</p>
<figure class="highlight sql"><table><tr><td class="code"><pre><span class="line"><span class="keyword">ALTER</span> <span class="keyword">USER</span> <span class="string">&#x27;root&#x27;</span>@<span class="string">&#x27;localhost&#x27;</span> IDENTIFIED <span class="keyword">WITH</span> mysql_native_password <span class="keyword">BY</span> <span class="string">&#x27;password&#x27;</span>;</span><br><span class="line"><span class="keyword">ALTER</span> <span class="keyword">USER</span> <span class="string">&#x27;root&#x27;</span>@<span class="string">&#x27;localhost&#x27;</span> IDENTIFIED <span class="keyword">WITH</span> mysql_native_password <span class="keyword">BY</span> <span class="string">&#x27;123&#x27;</span>;</span><br></pre></td></tr></table></figure>

<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414220650048.png" alt="image-20230414220650048"></p>
<h3 id="Tomcat"><a href="#Tomcat" class="headerlink" title="Tomcat"></a>Tomcat</h3><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230414221024844.png" alt="image-20230414221024844"></p>
<p>添加用户，推荐使用</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line">adduser user1</span><br></pre></td></tr></table></figure>

<p>注意版本号对应 tomcat10.1+ 对应 jdk11<img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230415091436057.png" alt="image-20230415091436057"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230415094146242.png" alt="image-20230415094146242"></p>
<p><a target="_blank" rel="noopener" href="http://192.168.88.128:8080/">Apache Tomcat&#x2F;10.1.7</a></p>
<h3 id="Nginx"><a href="#Nginx" class="headerlink" title="Nginx"></a>Nginx</h3><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230415101156216.png" alt="image-20230415101156216"></p>
<h3 id="RabbitMQ"><a href="#RabbitMQ" class="headerlink" title="RabbitMQ"></a>RabbitMQ</h3><h3 id="Redis"><a href="#Redis" class="headerlink" title="Redis"></a>Redis</h3><h3 id="Elasticsearch"><a href="#Elasticsearch" class="headerlink" title="Elasticsearch"></a>Elasticsearch</h3><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230415120935067.png" alt="image-20230415120935067"></p>
<h3 id="集群化软件安装前置准备"><a href="#集群化软件安装前置准备" class="headerlink" title="集群化软件安装前置准备"></a>集群化软件安装前置准备</h3><p>克隆虚拟机部署集群</p>
<p>修改固定ip</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line"># 修改主机名</span><br><span class="line">hostnamectl set-hostname node1</span><br><span class="line"></span><br><span class="line"># 修改IP地址</span><br><span class="line">sudo vim /etc/netplan/01-network-manager-all.yaml</span><br><span class="line"></span><br><span class="line"># 应用新配置</span><br><span class="line">sudo netplan apply</span><br><span class="line"></span><br><span class="line"># 重新配置并启动ens33网卡</span><br><span class="line">sudo dhclient ens33</span><br><span class="line"> </span><br><span class="line">sudo ifconfig ens33</span><br></pre></td></tr></table></figure>

<h3 id="ubuntu-22-04无法连接网络-sudo-service-network-manager-stop"><a href="#ubuntu-22-04无法连接网络-sudo-service-network-manager-stop" class="headerlink" title="ubuntu-22.04无法连接网络-sudo service network-manager stop"></a>ubuntu-22.04无法连接网络-sudo service network-manager stop</h3><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">sudo service NetworkManager stop</span><br><span class="line"> </span><br><span class="line">sudo rm /var/lib/NetworkManager/NetworkManager.state</span><br><span class="line"> </span><br><span class="line">sudo service NetworkManager start</span><br><span class="line"> </span><br><span class="line">sudo vim /etc/NetworkManager/NetworkManager.conf #在这个文件中把第四行的false改成true</span><br><span class="line"> </span><br><span class="line">sudo service NetworkManager restart</span><br></pre></td></tr></table></figure>

<p>192.168.88.128 ubuntu<br>192.168.88.129 node1<br>192.168.88.130 node2<br>192.168.88.131 node3</p>
<p>关闭selinux</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">apt install selinux-utils</span><br><span class="line"></span><br><span class="line">setenforce 0</span><br></pre></td></tr></table></figure>

<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230415140240157.png" alt="image-20230415140240157"></p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">init 0 # 关机</span><br><span class="line">init 6 # 重启</span><br></pre></td></tr></table></figure>

<h3 id="ssh免密配置"><a href="#ssh免密配置" class="headerlink" title="ssh免密配置"></a>ssh免密配置</h3><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">ssh-keygen -t rsa -b 4096</span><br><span class="line"></span><br><span class="line">ssh-copy-id node1</span><br><span class="line">ssh-copy-id node2</span><br><span class="line">ssh-copy-id node3</span><br></pre></td></tr></table></figure>

<h3 id="配置jdk环境"><a href="#配置jdk环境" class="headerlink" title="配置jdk环境"></a>配置jdk环境</h3><h3 id="zookeeper"><a href="#zookeeper" class="headerlink" title="zookeeper"></a>zookeeper</h3><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230415153403448.png" alt="image-20230415153403448"></p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">tar -zxvf apache-zookeeper-3.7.1-bin.tar.gz -C /export/server</span><br><span class="line"></span><br><span class="line">ln -s /export/server/apache-zookeeper-3.7.1-bin zookeeper</span><br></pre></td></tr></table></figure>

<p>修改zoo.cfg</p>
<p>&#x2F;export&#x2F;server&#x2F;zookeeper&#x2F;data</p>
<p>server.1&#x3D;node1:2888:3888<br>server.2&#x3D;node2:2888:3888<br>server.3&#x3D;node3:2888:3888</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">scp -r apache-zookeeper-3.7.1-bin node2:`pwd`</span><br></pre></td></tr></table></figure>

<h4 id="启动"><a href="#启动" class="headerlink" title="启动"></a>启动</h4><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">/export/server/zookeeper/bin/zkServer.sh start</span><br><span class="line"></span><br><span class="line">./zkCli.sh</span><br></pre></td></tr></table></figure>

<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230415162811256.png" alt="image-20230415162811256"></p>
<h3 id="kafka集群部署"><a href="#kafka集群部署" class="headerlink" title="kafka集群部署"></a>kafka集群部署</h3><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230415162859118.png" alt="image-20230415162859118"></p>
<h4 id="启动-1"><a href="#启动-1" class="headerlink" title="启动"></a>启动</h4><figure class="highlight shell"><table><tr><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">方式一：前台启动</span></span><br><span class="line">/export/server/kafka/bin/kafka-server-start.sh /export/server/kafka/config/server.properties</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">方式二：后台启动</span></span><br><span class="line">nohup /export/server/kafka/bin/kafka-server-start.sh /export/server/kafka/config/server.properties 2&gt;&amp;1 &gt;&gt; /export/server/kafka/kafka-server.log &amp;</span><br></pre></td></tr></table></figure>

<p>测试kafka能否正常使用</p>
<p>1.创建测试主题</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">/export/server/kafka/bin/kafka-console-producer.sh --create --zookeeper node1:2181 --replication-factor 1 --partitions 3 --topic test</span><br></pre></td></tr></table></figure>

<p>2.运行测试，在finalshell中打开两个node1终端页面</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line"># 打开一个终端页面，启动一个模拟的数据生产者</span><br><span class="line">/export/server/kafka/bin/kafka-console-producer.sh --broker-list node1:9092 --topic test</span><br><span class="line"># 再打开一个新的终端页面，在启动一个新的数据消费者</span><br><span class="line">/export/server/kafka/bin/kafka-console-consumer.sh --bootstrap-server node1:9092 --topic test --from-beginning</span><br></pre></td></tr></table></figure>

<h2 id="hadoop"><a href="#hadoop" class="headerlink" title="hadoop"></a>hadoop</h2><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230415171226193.png" alt="image-20230415171226193"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230415171455339.png" alt="image-20230415171455339"></p>
<p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230415172416484.png" alt="image-20230415172416484"></p>
<h4 id="修改配置文件"><a href="#修改配置文件" class="headerlink" title="修改配置文件"></a>修改配置文件</h4><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">/export/server/hadoop/etc/hadoop</span><br><span class="line">vim hadoop-env.sh</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line"># 在文件开头加入</span><br><span class="line"># 配置Java安装路径</span><br><span class="line">export JAVA_HOME=/export/server/jdk</span><br><span class="line"># 配置Hadoop安装路径</span><br><span class="line">export HADOOP_HOME=/export/server/hadoop</span><br><span class="line"># Hadoop hdfs配置文件路径</span><br><span class="line">export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop</span><br><span class="line"># Hadoop YARN 日志文件夹</span><br><span class="line">export YARN_LOG_DIR=$HADOOP_HOME/logs/yarn</span><br><span class="line"># Hadoop hdfs 日志文件夹</span><br><span class="line">export HADOOP_LOG_DIR=$HADOOP_HOME/logs/hdfs</span><br><span class="line"></span><br><span class="line"># Hadoop的使用启动用户配置</span><br><span class="line">export HDFS_NAMENODE_USER=root</span><br><span class="line">export HDFS_DATANODE_USER=root</span><br><span class="line">export HDFS_SECONDARYNAMENODE_USER=root</span><br><span class="line">export YARN_RESOURCEMANAGER_USER=root</span><br><span class="line">export YARN_NODEMANAGER_USER=root</span><br><span class="line">export YARN_PROXYSERVER_USER=root</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h4 id="core-site-xml"><a href="#core-site-xml" class="headerlink" title="core-site.xml"></a>core-site.xml</h4><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span><br><span class="line">&lt;?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;configuration.xsl&quot;?&gt;</span><br><span class="line"></span><br><span class="line">&lt;configuration&gt;</span><br><span class="line">       &lt;!--指定namenode的地址--&gt;</span><br><span class="line">   &lt;property&gt;</span><br><span class="line">     &lt;name&gt;fs.defaultFS&lt;/name&gt;</span><br><span class="line">     &lt;value&gt;hdfs://node1:8020&lt;/value&gt;</span><br><span class="line">     &lt;description&gt;&lt;/description&gt;</span><br><span class="line">   &lt;/property&gt;</span><br><span class="line">   &lt;!--用来指定使用hadoop时产生文件的存放目录--&gt;</span><br><span class="line">   &lt;property&gt;</span><br><span class="line">     &lt;name&gt;io.file.buffer.size&lt;/name&gt;</span><br><span class="line">     &lt;value&gt;131072&lt;/value&gt;</span><br><span class="line">     &lt;description&gt;&lt;/description&gt;</span><br><span class="line">   &lt;/property&gt;</span><br><span class="line">&lt;/configuration&gt;</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h4 id="hdfs-site-xml"><a href="#hdfs-site-xml" class="headerlink" title="hdfs-site.xml"></a>hdfs-site.xml</h4><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">&lt;configuration&gt;</span><br><span class="line">    &lt;!--指定hdfs保存数据的副本数量--&gt;</span><br><span class="line">    &lt;property&gt;</span><br><span class="line">            &lt;name&gt;dfs.datanode.data.dir.perm&lt;/name&gt;</span><br><span class="line">            &lt;value&gt;700&lt;/value&gt;</span><br><span class="line">    &lt;/property&gt;</span><br><span class="line">    &lt;!--指定hdfs中namenode的存储位置--&gt;</span><br><span class="line">    &lt;property&gt;</span><br><span class="line">             &lt;name&gt;dfs.namenode.name.dir&lt;/name&gt; </span><br><span class="line">             &lt;value&gt;/data/nn&lt;/value&gt;</span><br><span class="line">             &lt;description&gt;Path on the local filesystem where the NameNode stores the namespace and transactions logs persistently.&lt;/description&gt;</span><br><span class="line">    &lt;/property&gt;</span><br><span class="line">    &lt;property&gt;</span><br><span class="line">             &lt;name&gt;dfs.namenode.hosts&lt;/name&gt; </span><br><span class="line">             &lt;value&gt;node1,node2,node3&lt;/value&gt;</span><br><span class="line">             &lt;description&gt;List of permitted DataNodes.&lt;/description&gt;</span><br><span class="line">    &lt;/property&gt;</span><br><span class="line">    &lt;property&gt;</span><br><span class="line">             &lt;name&gt;dfs.blocksize&lt;/name&gt; </span><br><span class="line">             &lt;value&gt;268435456&lt;/value&gt;</span><br><span class="line">             &lt;description&gt;&lt;/description&gt;</span><br><span class="line">    &lt;/property&gt;</span><br><span class="line">    &lt;property&gt;</span><br><span class="line">             &lt;name&gt;dfs.namenode.handler.count&lt;/name&gt; </span><br><span class="line">             &lt;value&gt;100&lt;/value&gt;</span><br><span class="line">             &lt;description&gt;&lt;/description&gt;</span><br><span class="line">    &lt;/property&gt;</span><br><span class="line">    &lt;!--指定hdfs中datanode的存储位置--&gt;</span><br><span class="line">    &lt;property&gt;</span><br><span class="line">             &lt;name&gt;dfs.datanode.data.dir&lt;/name&gt;</span><br><span class="line">             &lt;value&gt;/data/dn&lt;/value&gt;</span><br><span class="line">    &lt;/property&gt;</span><br><span class="line"></span><br><span class="line">&lt;/configuration&gt;</span><br></pre></td></tr></table></figure>

<h4 id="mapred-env-sh"><a href="#mapred-env-sh" class="headerlink" title="mapred-env.sh"></a>mapred-env.sh</h4><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line"># 在文件的开头加入如下环境变量设置</span><br><span class="line"># 设置JDK路径</span><br><span class="line">export JAVA_HOME=/export/server/jdk</span><br><span class="line"># 设置JobHistoryServer进程内存为1G</span><br><span class="line">export HADOOP_JOB_HISTORYSERVER_HEAPSIZE=1000</span><br><span class="line"># 设置日志级别为INFO</span><br><span class="line">export HADOOP_MAPRED_ROOT_LOGGER=INFO,RFA</span><br></pre></td></tr></table></figure>

<h4 id="mapred-site-xml"><a href="#mapred-site-xml" class="headerlink" title="mapred-site.xml"></a>mapred-site.xml</h4><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">&lt;property&gt;</span><br><span class="line"> &lt;name&gt;mapreduce.framework.name&lt;/name&gt;</span><br><span class="line">    &lt;value&gt;yarn&lt;/value&gt;</span><br><span class="line">    &lt;description&gt;MapReduce的运行框架设置为YARN&lt;/description&gt;</span><br><span class="line">&lt;/property&gt;</span><br><span class="line"></span><br><span class="line">&lt;property&gt;</span><br><span class="line"> &lt;name&gt;mapreduce.jobhistory.address&lt;/name&gt;</span><br><span class="line">    &lt;value&gt;node1:10020&lt;/value&gt;</span><br><span class="line">    &lt;descrpition&gt;历史服务器通讯端口为node1:10020&lt;/descrpition&gt;&gt;</span><br><span class="line">&lt;/property&gt;</span><br><span class="line"></span><br><span class="line">&lt;property&gt;</span><br><span class="line"> &lt;name&gt;mapreduce.jobhistory.webapp.address&lt;/name&gt;</span><br><span class="line">    &lt;value&gt;node1:19888&lt;/value&gt;</span><br><span class="line">    &lt;descrpition&gt;历史服务器web端口为node1:19888&lt;/descrpition&gt;&gt;</span><br><span class="line">&lt;/property&gt;</span><br><span class="line"></span><br><span class="line">&lt;property&gt;</span><br><span class="line"> &lt;name&gt;mapreduce.jobhistory.intermediate-done-dir&lt;/name&gt;</span><br><span class="line">    &lt;value&gt;/data/mr-history/tmp&lt;/value&gt;</span><br><span class="line">    &lt;descrpition&gt;历史信息在HDFS的记录临时路径&lt;/descrpition&gt;&gt;</span><br><span class="line">&lt;/property&gt;</span><br><span class="line"></span><br><span class="line">&lt;property&gt;</span><br><span class="line"> &lt;name&gt;mapreduce.jobhistory.done-dir&lt;/name&gt;</span><br><span class="line">    &lt;value&gt;/data/mr-history/done&lt;/value&gt;</span><br><span class="line">    &lt;descrpition&gt;历史信息在HDFS的记录路径&lt;/descrpition&gt;&gt;</span><br><span class="line">&lt;/property&gt;</span><br><span class="line"></span><br><span class="line">&lt;property&gt;</span><br><span class="line"> &lt;name&gt;mapreduce.jobhistory.am.env&lt;/name&gt;</span><br><span class="line">    &lt;value&gt;HADOOP_MAPRED_HOME=$HADOOP_HOME&lt;/value&gt;</span><br><span class="line">    &lt;descrpition&gt;MapReduce Home 设置为HADOOP_HOME&lt;/descrpition&gt;&gt;</span><br><span class="line">&lt;/property&gt;</span><br><span class="line"></span><br><span class="line">&lt;property&gt;</span><br><span class="line"> &lt;name&gt;mapreduce.map.env&lt;/name&gt;</span><br><span class="line">    &lt;value&gt;HADOOP_MAPRED_HOME=$HADOOP_HOME&lt;/value&gt;</span><br><span class="line">    &lt;descrpition&gt;MapReduce Home 设置为HADOOP_HOME&lt;/descrpition&gt;&gt;</span><br><span class="line">&lt;/property&gt;</span><br><span class="line"></span><br><span class="line">&lt;property&gt;</span><br><span class="line"> &lt;name&gt;mapreduce.reduce.env&lt;/name&gt;</span><br><span class="line">    &lt;value&gt;HADOOP_MAPRED_HOME=$HADOOP_HOME&lt;/value&gt;</span><br><span class="line">    &lt;descrpition&gt;MapReduce Home 设置为HADOOP_HOME&lt;/descrpition&gt;&gt;</span><br><span class="line">&lt;/property&gt;</span><br></pre></td></tr></table></figure>

<h4 id="YARN配置文件"><a href="#YARN配置文件" class="headerlink" title="YARN配置文件"></a>YARN配置文件</h4><ul>
<li><code>yarn-env.sh</code></li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line"># 设置JDK路径</span><br><span class="line">export JAVA_HOME=/export/server/jdk</span><br><span class="line"># 设置HADOOP_HOME的环境变量</span><br><span class="line">export HDAOOP_HOME=/export/server/hadoop</span><br><span class="line"># 设置配置文件路径的环境变量</span><br><span class="line">export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop</span><br><span class="line"># 设置日志文件路径的环境变量</span><br><span class="line">export HADOOP_LOG_DIR=$HADOOP_HOME/logs</span><br></pre></td></tr></table></figure>

<ul>
<li><code>yarn-site.xml</code></li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">&lt;property&gt;</span><br><span class="line">  &lt;name&gt;yarn.resourcemanager.hostname&lt;/name&gt;</span><br><span class="line">  &lt;value&gt;node1&lt;/value&gt;</span><br><span class="line">  &lt;description&gt;ResourceManager设置在node1节点&lt;/description&gt;</span><br><span class="line">&lt;/property&gt;</span><br><span class="line"></span><br><span class="line">&lt;property&gt;</span><br><span class="line">  &lt;name&gt;yarn.nodemanager.local-dirs&lt;/name&gt;</span><br><span class="line">  &lt;value&gt;/data/nm-local&lt;/value&gt;</span><br><span class="line">  &lt;description&gt;NodeManager中间数据本地存储路径&lt;/description&gt;</span><br><span class="line">&lt;/property&gt;</span><br><span class="line"></span><br><span class="line">&lt;property&gt;</span><br><span class="line">  &lt;name&gt;yarn.nodemanager.log-dirs&lt;/name&gt;</span><br><span class="line">  &lt;value&gt;/data/nm-log&lt;/value&gt;</span><br><span class="line">  &lt;description&gt;NodeManager数据日志本地储存路径&lt;/description&gt;</span><br><span class="line">&lt;/property&gt;</span><br><span class="line"></span><br><span class="line">&lt;property&gt;</span><br><span class="line">  &lt;name&gt;yarn.nodemanager.aux-services&lt;/name&gt;</span><br><span class="line">  &lt;value&gt;mapreduce_shuffle&lt;/value&gt;</span><br><span class="line">  &lt;description&gt;为MapReduce程序开启Shuffle服务&lt;/description&gt;</span><br><span class="line">&lt;/property&gt;</span><br><span class="line"></span><br><span class="line">&lt;property&gt;</span><br><span class="line">  &lt;name&gt;yarn.log.server.url&lt;/name&gt;</span><br><span class="line">  &lt;value&gt;http://node1:19888/jobhistory/logs&lt;/value&gt;</span><br><span class="line">  &lt;description&gt;历史服务器URL&lt;/description&gt;</span><br><span class="line">&lt;/property&gt;</span><br><span class="line"></span><br><span class="line">&lt;property&gt;</span><br><span class="line">  &lt;name&gt;yarn.web-proxy.address&lt;/name&gt;</span><br><span class="line">  &lt;value&gt;node1:8089&lt;/value&gt;</span><br><span class="line">  &lt;description&gt;代理服务器主机和端口&lt;/description&gt;</span><br><span class="line">&lt;/property&gt;</span><br><span class="line"></span><br><span class="line">&lt;property&gt;</span><br><span class="line">  &lt;name&gt;yarn.log-aggregation-enable&lt;/name&gt;</span><br><span class="line">  &lt;value&gt;true&lt;/value&gt;</span><br><span class="line">  &lt;description&gt;开启日志聚合&lt;/description&gt;</span><br><span class="line">&lt;/property&gt;</span><br><span class="line"></span><br><span class="line">&lt;property&gt;</span><br><span class="line">  &lt;name&gt;yarn.nodemanager.remote-app-log-dir&lt;/name&gt;</span><br><span class="line">  &lt;value&gt;/tmp/logs&lt;/value&gt;</span><br><span class="line">  &lt;description&gt;程序日志HDFS的尺寸路径&lt;/description&gt;</span><br><span class="line">&lt;/property&gt;</span><br><span class="line"></span><br><span class="line">&lt;property&gt;</span><br><span class="line">  &lt;name&gt;yarn.resourcemanager.scheduler.class&lt;/name&gt;</span><br><span class="line">  &lt;value&gt;org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler&lt;/value&gt;</span><br><span class="line">  &lt;description&gt;选择公平调度器&lt;/description&gt;</span><br><span class="line">&lt;/property&gt;</span><br></pre></td></tr></table></figure>

<h4 id="分发hadoop，创建软连接"><a href="#分发hadoop，创建软连接" class="headerlink" title="分发hadoop，创建软连接"></a>分发hadoop，创建软连接</h4><p><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/typora/image-20230415191436368.png" alt="image-20230415191436368"></p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">scp mapred-env.sh mapred-site.xml yarn-env.sh yarn-site.xml node2:`pwd`/</span><br></pre></td></tr></table></figure>

<p>格式化NameNode，在node1执行</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">hadoop namenode -format</span><br></pre></td></tr></table></figure>

<p>启动hadoop的dfs集群，在node1执行即可</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">start-dfs.sh</span><br><span class="line"></span><br><span class="line"># 如需停止可以执行</span><br><span class="line">stop-dfs.sh</span><br></pre></td></tr></table></figure>

<p>启动hadoop的yarn集群，在node1执行即可</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">start-yarn.sh</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p>启动历史服务器</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">mapred --daemon start historyserver</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p>启动web代理服务器</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">yarn-daemon.sh start proxyserver</span><br></pre></td></tr></table></figure>

<p>三种hadoop启动方式</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">第一种方式</span><br><span class="line"></span><br><span class="line">启动：分别启动HDFS和MapReduce</span><br><span class="line"></span><br><span class="line">命令如下：start-dfs.sh start-mapreted.sh</span><br><span class="line"></span><br><span class="line">命令如下：stop-dfs.sh  stop-mapreted.sh</span><br><span class="line"></span><br><span class="line">第二种方式</span><br><span class="line"></span><br><span class="line">全部启动或者全部停止</span><br><span class="line"></span><br><span class="line">启动：</span><br><span class="line"></span><br><span class="line">命令：start-all.sh</span><br><span class="line"></span><br><span class="line">启动顺序：NameNode，DateNode，SecondaryNameNode，JobTracker，TaskTracker</span><br><span class="line"></span><br><span class="line"> </span><br><span class="line"></span><br><span class="line">停止：</span><br><span class="line"></span><br><span class="line">命令：stop-all.sh</span><br><span class="line"></span><br><span class="line">关闭顺序性：JobTracker，TaskTracker，NameNode，DateNode，SecondaryNameNode</span><br><span class="line"></span><br><span class="line"> </span><br><span class="line"></span><br><span class="line">第三种启动方式</span><br><span class="line"></span><br><span class="line">每个守护线程逐一启动，启动顺序如下：</span><br><span class="line"></span><br><span class="line">NameNode，DateNode，SecondaryNameNode，JobTracker，TaskTracker</span><br><span class="line"></span><br><span class="line">命令如下：</span><br><span class="line"></span><br><span class="line">启动：</span><br><span class="line"></span><br><span class="line">      hadoop-daemon.shdaemon(守护进程)</span><br><span class="line"></span><br><span class="line"> </span><br><span class="line"></span><br><span class="line">hadoop-daemon.sh start namenode</span><br><span class="line"></span><br><span class="line">hadoop-daemon.sh start datenode</span><br><span class="line"></span><br><span class="line"> </span><br><span class="line"></span><br><span class="line">hadoop-daemon.sh start secondarynamenode</span><br><span class="line"></span><br><span class="line">hadoop-daemon.sh start jobtracker</span><br><span class="line"></span><br><span class="line">hadoop-daemon.sh start tasktracker</span><br><span class="line"></span><br><span class="line"> </span><br><span class="line"></span><br><span class="line">关闭命令：</span><br><span class="line"></span><br><span class="line">hadoop-daemon.sh stop tasktracker</span><br><span class="line"></span><br><span class="line"> </span><br><span class="line"></span><br><span class="line">hadoop-daemons.sh 启动多个进程</span><br><span class="line"></span><br><span class="line">datanode与tasktracker会分不到多台机器上，从节点启动，就使用</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line"># 验证yarn</span><br><span class="line">hadoop jar /export/server/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-3.3.5.jar wordcount -Dmapred.job.queue.name=root.root /test.txt /output</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">&lt;property&gt;</span><br><span class="line">    &lt;name&gt;yarn.nodemanager.resource.memory-mb&lt;/name&gt;</span><br><span class="line">    &lt;value&gt;2048&lt;/value&gt;</span><br><span class="line">&lt;/property&gt;</span><br><span class="line">&lt;property&gt;</span><br><span class="line">   &lt;name&gt;yarn.scheduler.minimum-allocation-mb&lt;/name&gt;</span><br><span class="line">   &lt;value&gt;2048&lt;/value&gt;</span><br><span class="line">&lt;/property&gt;</span><br><span class="line">&lt;property&gt;</span><br><span class="line">    &lt;name&gt;yarn.nodemanager.vmem-pmem-ratio&lt;/name&gt;</span><br><span class="line">    &lt;value&gt;2.1&lt;/value&gt;</span><br><span class="line">&lt;/property&gt;</span><br></pre></td></tr></table></figure>

<h2 id="脚本-amp-自动化"><a href="#脚本-amp-自动化" class="headerlink" title="脚本&amp;自动化"></a>脚本&amp;自动化</h2><h2 id="项目实战"><a href="#项目实战" class="headerlink" title="项目实战"></a>项目实战</h2><h2 id="云平台技术"><a href="#云平台技术" class="headerlink" title="云平台技术"></a>云平台技术</h2><h2 id="Q-amp-A"><a href="#Q-amp-A" class="headerlink" title="Q&amp;A"></a>Q&amp;A</h2><p>finalshell 使用root登录</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">vim /etc/ssh/sshd_config</span><br></pre></td></tr></table></figure>

<p><img src="https://pic1.zhimg.com/80/v2-08fd360c30c8a743862f323684945df0_720w.webp" alt="img"></p>
<p>在linux终端命令行中输入以下命令重启ssh服务</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">sudo /etc/init.d/ssh restart</span><br></pre></td></tr></table></figure>

<h3 id="安装包失败"><a href="#安装包失败" class="headerlink" title="安装包失败"></a>安装包失败</h3><p>使用下面命令来安装想安装的包：</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">sudo aptitude install &lt;package-name&gt;</span><br></pre></td></tr></table></figure>

<p>如果提示 sudo: aptitude: command not found，则先安装 aptitude，即输入：</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">sudo apt-get install aptitude</span><br></pre></td></tr></table></figure>

<p>再重新尝试使用aptitude安装。aptitude会尝试解决问题，并给出解决方案，询问你是否接受。</p>
<h3 id="Ubuntu上不了网"><a href="#Ubuntu上不了网" class="headerlink" title="Ubuntu上不了网"></a>Ubuntu上不了网</h3><p><strong>ifconfig查看只有lo,没有ens33</strong></p>
<p>解决办法：重新配置并启动ens33网卡</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">sudo dhclient ens33</span><br><span class="line"> </span><br><span class="line">sudo ifconfig ens33</span><br></pre></td></tr></table></figure>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="https://gitee.com/frode117">frode</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://gitee.com/frode117/2023/04/16/linux%E5%AD%A6%E4%B9%A0/">https://gitee.com/frode117/2023/04/16/linux学习/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://gitee.com/frode117" target="_blank">mundane</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/mundane/tags/linux/">linux</a><a class="post-meta__tags" href="/mundane/tags/%E8%99%9A%E6%8B%9F%E6%9C%BA/">虚拟机</a><a class="post-meta__tags" href="/mundane/tags/ubuntu/">ubuntu</a></div><div class="post_share"><div class="social-share" data-image="/mundane/img/twist.png" data-sites="twitter,wechat,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/mundane/2023/04/27/hadoop-study/" title="hadoop学习"><img class="cover" src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/img/67190321_p0.png" onerror="onerror=null;src='/mundane/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">hadoop学习</div></div></a></div><div class="next-post pull-right"><a href="/mundane/2023/04/15/hello-world/" title="Hello World"><img class="cover" src="/mundane/img/girl.jpg" onerror="onerror=null;src='/mundane/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Hello World</div></div></a></div></nav><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div class="vcomment" id="vcomment"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/mundane/img/violet.jpg" onerror="this.onerror=null;this.src='/mundane/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">frode</div><div class="author-info__description">this is my blog</div></div><div class="card-info-data site-data is-center"><a href="/mundane/archives/"><div class="headline">文章</div><div class="length-num">4</div></a><a href="/mundane/tags/"><div class="headline">标签</div><div class="length-num">8</div></a><a href="/mundane/categories/"><div class="headline">分类</div><div class="length-num">4</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/munDane117"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">stay hungry,stay foolish</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#Linux"><span class="toc-number">1.</span> <span class="toc-text">Linux</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#WSL"><span class="toc-number">1.1.</span> <span class="toc-text">WSL</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Linux%E7%9A%84%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84"><span class="toc-number">1.2.</span> <span class="toc-text">Linux的目录结构</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Linux%E5%9F%BA%E7%A1%80%E5%91%BD%E4%BB%A4"><span class="toc-number">1.3.</span> <span class="toc-text">Linux基础命令</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%91%BD%E4%BB%A4%E5%92%8C%E5%91%BD%E4%BB%A4%E8%A1%8C"><span class="toc-number">1.3.1.</span> <span class="toc-text">命令和命令行</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#ls%E5%91%BD%E4%BB%A4%E5%85%A5%E9%97%A8"><span class="toc-number">1.3.2.</span> <span class="toc-text">ls命令入门</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%96%87%E4%BB%B6%E6%93%8D%E4%BD%9C%E5%91%BD%E4%BB%A4"><span class="toc-number">1.3.3.</span> <span class="toc-text">文件操作命令</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AE%A1%E9%81%93%E7%AC%A6"><span class="toc-number">1.3.4.</span> <span class="toc-text">管道符</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#vim%E5%91%BD%E4%BB%A4"><span class="toc-number">1.3.5.</span> <span class="toc-text">vim命令</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#scp%E5%91%BD%E4%BB%A4"><span class="toc-number">1.3.6.</span> <span class="toc-text">scp命令</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Linux%E6%9D%83%E9%99%90%E7%AE%A1%E6%8E%A7"><span class="toc-number">1.4.</span> <span class="toc-text">Linux权限管控</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Linux%E5%AE%9E%E7%94%A8%E6%93%8D%E4%BD%9C"><span class="toc-number">1.5.</span> <span class="toc-text">Linux实用操作</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%BD%AF%E9%93%BE%E6%8E%A5"><span class="toc-number">1.5.1.</span> <span class="toc-text">软链接</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%98%BE%E7%A4%BA%E6%97%B6%E9%97%B4"><span class="toc-number">1.5.2.</span> <span class="toc-text">显示时间</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%A0%A1%E5%87%86%E6%97%B6%E9%97%B4"><span class="toc-number">1.5.2.1.</span> <span class="toc-text">校准时间</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%AE%BE%E7%BD%AE%E9%9D%99%E6%80%81ip"><span class="toc-number">1.5.3.</span> <span class="toc-text">设置静态ip</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AB%AF%E5%8F%A3"><span class="toc-number">1.5.4.</span> <span class="toc-text">端口</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%87%AA%E8%A1%8C%E8%AE%BE%E7%BD%AE%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F"><span class="toc-number">1.5.5.</span> <span class="toc-text">自行设置环境变量</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8E%8B%E7%BC%A9%E8%A7%A3%E5%8E%8B"><span class="toc-number">1.5.6.</span> <span class="toc-text">压缩解压</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%AE%9E%E6%88%98%E8%BD%AF%E4%BB%B6%E9%83%A8%E7%BD%B2"><span class="toc-number">1.6.</span> <span class="toc-text">实战软件部署</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Mysql"><span class="toc-number">1.6.1.</span> <span class="toc-text">Mysql</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Tomcat"><span class="toc-number">1.6.2.</span> <span class="toc-text">Tomcat</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Nginx"><span class="toc-number">1.6.3.</span> <span class="toc-text">Nginx</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#RabbitMQ"><span class="toc-number">1.6.4.</span> <span class="toc-text">RabbitMQ</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Redis"><span class="toc-number">1.6.5.</span> <span class="toc-text">Redis</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Elasticsearch"><span class="toc-number">1.6.6.</span> <span class="toc-text">Elasticsearch</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%9B%86%E7%BE%A4%E5%8C%96%E8%BD%AF%E4%BB%B6%E5%AE%89%E8%A3%85%E5%89%8D%E7%BD%AE%E5%87%86%E5%A4%87"><span class="toc-number">1.6.7.</span> <span class="toc-text">集群化软件安装前置准备</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#ubuntu-22-04%E6%97%A0%E6%B3%95%E8%BF%9E%E6%8E%A5%E7%BD%91%E7%BB%9C-sudo-service-network-manager-stop"><span class="toc-number">1.6.8.</span> <span class="toc-text">ubuntu-22.04无法连接网络-sudo service network-manager stop</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#ssh%E5%85%8D%E5%AF%86%E9%85%8D%E7%BD%AE"><span class="toc-number">1.6.9.</span> <span class="toc-text">ssh免密配置</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%85%8D%E7%BD%AEjdk%E7%8E%AF%E5%A2%83"><span class="toc-number">1.6.10.</span> <span class="toc-text">配置jdk环境</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#zookeeper"><span class="toc-number">1.6.11.</span> <span class="toc-text">zookeeper</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%90%AF%E5%8A%A8"><span class="toc-number">1.6.11.1.</span> <span class="toc-text">启动</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#kafka%E9%9B%86%E7%BE%A4%E9%83%A8%E7%BD%B2"><span class="toc-number">1.6.12.</span> <span class="toc-text">kafka集群部署</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%90%AF%E5%8A%A8-1"><span class="toc-number">1.6.12.1.</span> <span class="toc-text">启动</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#hadoop"><span class="toc-number">1.7.</span> <span class="toc-text">hadoop</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"><span class="toc-number">1.7.0.1.</span> <span class="toc-text">修改配置文件</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#core-site-xml"><span class="toc-number">1.7.0.2.</span> <span class="toc-text">core-site.xml</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#hdfs-site-xml"><span class="toc-number">1.7.0.3.</span> <span class="toc-text">hdfs-site.xml</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#mapred-env-sh"><span class="toc-number">1.7.0.4.</span> <span class="toc-text">mapred-env.sh</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#mapred-site-xml"><span class="toc-number">1.7.0.5.</span> <span class="toc-text">mapred-site.xml</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#YARN%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"><span class="toc-number">1.7.0.6.</span> <span class="toc-text">YARN配置文件</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%86%E5%8F%91hadoop%EF%BC%8C%E5%88%9B%E5%BB%BA%E8%BD%AF%E8%BF%9E%E6%8E%A5"><span class="toc-number">1.7.0.7.</span> <span class="toc-text">分发hadoop，创建软连接</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%84%9A%E6%9C%AC-amp-%E8%87%AA%E5%8A%A8%E5%8C%96"><span class="toc-number">1.8.</span> <span class="toc-text">脚本&amp;自动化</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%A1%B9%E7%9B%AE%E5%AE%9E%E6%88%98"><span class="toc-number">1.9.</span> <span class="toc-text">项目实战</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BA%91%E5%B9%B3%E5%8F%B0%E6%8A%80%E6%9C%AF"><span class="toc-number">1.10.</span> <span class="toc-text">云平台技术</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Q-amp-A"><span class="toc-number">1.11.</span> <span class="toc-text">Q&amp;A</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85%E5%8C%85%E5%A4%B1%E8%B4%A5"><span class="toc-number">1.11.1.</span> <span class="toc-text">安装包失败</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Ubuntu%E4%B8%8A%E4%B8%8D%E4%BA%86%E7%BD%91"><span class="toc-number">1.11.2.</span> <span class="toc-text">Ubuntu上不了网</span></a></li></ol></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/mundane/2023/04/27/mysql-study/" title="mysql学习"><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/img/suzume.png" onerror="this.onerror=null;this.src='/mundane/img/404.jpg'" alt="mysql学习"/></a><div class="content"><a class="title" href="/mundane/2023/04/27/mysql-study/" title="mysql学习">mysql学习</a><time datetime="2023-04-27T15:01:33.000Z" title="发表于 2023-04-27 23:01:33">2023-04-27</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/mundane/2023/04/27/hadoop-study/" title="hadoop学习"><img src="https://mundane-1317827053.cos.ap-chengdu.myqcloud.com/img/67190321_p0.png" onerror="this.onerror=null;this.src='/mundane/img/404.jpg'" alt="hadoop学习"/></a><div class="content"><a class="title" href="/mundane/2023/04/27/hadoop-study/" title="hadoop学习">hadoop学习</a><time datetime="2023-04-27T14:47:36.000Z" title="发表于 2023-04-27 22:47:36">2023-04-27</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/mundane/2023/04/16/linux%E5%AD%A6%E4%B9%A0/" title="linux学习"><img src="/mundane/img/twist.png" onerror="this.onerror=null;this.src='/mundane/img/404.jpg'" alt="linux学习"/></a><div class="content"><a class="title" href="/mundane/2023/04/16/linux%E5%AD%A6%E4%B9%A0/" title="linux学习">linux学习</a><time datetime="2023-04-16T14:52:19.000Z" title="发表于 2023-04-16 22:52:19">2023-04-16</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/mundane/2023/04/15/hello-world/" title="Hello World"><img src="/mundane/img/girl.jpg" onerror="this.onerror=null;this.src='/mundane/img/404.jpg'" alt="Hello World"/></a><div class="content"><a class="title" href="/mundane/2023/04/15/hello-world/" title="Hello World">Hello World</a><time datetime="2023-04-15T12:52:02.200Z" title="发表于 2023-04-15 20:52:02">2023-04-15</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2023 By frode</div><div class="footer_custom_text">1024</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/mundane/js/utils.js"></script><script src="/mundane/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><div class="js-pjax"><script>if (!window.MathJax) {
  window.MathJax = {
    tex: {
      inlineMath: [ ['$','$'], ["\\(","\\)"]],
      tags: 'ams'
    },
    chtml: {
      scale: 1.1
    },
    options: {
      renderActions: {
        findScript: [10, doc => {
          for (const node of document.querySelectorAll('script[type^="math/tex"]')) {
            const display = !!node.type.match(/; *mode=display/)
            const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display)
            const text = document.createTextNode('')
            node.parentNode.replaceChild(text, node)
            math.start = {node: text, delim: '', n: 0}
            math.end = {node: text, delim: '', n: 0}
            doc.math.push(math)
          }
        }, ''],
        insertScript: [200, () => {
          document.querySelectorAll('mjx-container').forEach(node => {
            if (node.hasAttribute('display')) {
              btf.wrap(node, 'div', { class: 'mathjax-overflow' })
            } else {
              btf.wrap(node, 'span', { class: 'mathjax-overflow' })
            }
          });
        }, '', false]
      }
    }
  }
  
  const script = document.createElement('script')
  script.src = 'https://cdn.jsdelivr.net/npm/mathjax/es5/tex-mml-chtml.min.js'
  script.id = 'MathJax-script'
  script.async = true
  document.head.appendChild(script)
} else {
  MathJax.startup.document.state(0)
  MathJax.texReset()
  MathJax.typesetPromise()
}</script><script>function loadValine () {
  function initValine () {
    const valine = new Valine(Object.assign({
      el: '#vcomment',
      appId: 'pgTqrs90s3uW64aIgVnjZkoo-gzGzoHsz',
      appKey: 'BlDuaZ3JC6jkoZ5xHIpAUJbH',
      avatar: 'monsterid',
      serverURLs: '',
      emojiMaps: "",
      path: window.location.pathname,
      visitor: false
    }, null))
  }

  if (typeof Valine === 'function') initValine() 
  else getScript('/mundane/js/Valine.min.js').then(initValine)
}

if ('Valine' === 'Valine' || !true) {
  if (true) btf.loadComment(document.getElementById('vcomment'),loadValine)
  else setTimeout(loadValine, 0)
} else {
  function loadOtherComment () {
    loadValine()
  }
}</script></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div class="no-result" id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/mundane/js/search/local-search.js"></script></div></div></body></html>